﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PSE.Framework.Service.Security.SecurityTokenService
{
    /// <summary>
    /// Constantes de auxílio para o SecurityTokenService
    /// </summary>
    public static class Constants
    {
        public const string AssertionIdPrefix = "SamlSecurityToken-";

        /// <summary>
        /// Constantes com os tipos de token utilizados.
        /// </summary>
        public static class TokenTypes
        {
            public const string SAML = "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1";
        }

        /// <summary>
        /// Constantes do Addressing
        /// </summary>
        public static class Addressing
        {
            public const string NamespaceUri = "http://www.w3.org/2005/08/addressing";
            public const string NamespaceUriAugust2004 = "http://schemas.xmlsoap.org/ws/2004/08/addressing";

            /// <summary>
            /// Elementos do Addressing
            /// </summary>
            public class Elements
            {
                public const string EndpointReference = "EndpointReference";
            }
        }

        /// <summary>
        /// Constantes do IdentityModel
        /// </summary>
        public static class IdentityModel
        {
            public const string NamespaceUri = "http://schemas.microsoft.com/ws/2005/05/identity";

            /// <summary>
            /// Constantes de Atributos
            /// </summary>
            public class Attributes
            {
                public const string Uri = "Uri";
                public const string Optional = "Optional";
            }
            /// <summary>
            /// Constantes dos ClaimTypes
            /// </summary>
            public class ClaimTypes
            {
                public const string PPI = "http://schemas.microsoft.com/ws/2005/05/identity/claims/privatepersonalidentifier";
            }
            /// <summary>
            /// Contantes de Elementos dos Atributos
            /// </summary>
            public class Elements
            {
                public const string Claim = "ClaimType";
            }
        }

        /// <summary>
        /// Constantes de Policy
        /// </summary>
        public static class Policy
        {
            public const string NamespaceUri = "http://schemas.xmlsoap.org/ws/2004/09/policy";
            /// <summary>
            /// Constantes de Elementos de Policy
            /// </summary>
            public class Elements
            {
                public const string AppliesTo = "AppliesTo";
            }
        }

        /// <summary>
        /// Namespace do WS-Security
        /// </summary>
        public static class SecurityUtil
        {
            public const string NamespaceUri = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
        }

        /// <summary>
        /// Várias constantes para o WS-Trust
        /// </summary>
        public static class Trust
        {
            public const string NamespaceUri = "http://schemas.xmlsoap.org/ws/2005/02/trust";

            /// <summary>
            /// Constantes de ações
            /// </summary>
            public class Actions
            {
                public const string Issue = "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue";
                public const string IssueReply = "http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue";
                public const string Validate = "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Validate";
                public const string ValidateReply = "http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Validate";
            }

            /// <summary>
            /// Constantes dos atributos da mensagem
            /// </summary>
            public class Attributes
            {
                public const string Context = "Context";
                public const string Type = "Type";
            }

            /// <summary>
            /// Constantes dos elementos da mensagem
            /// </summary>
            public class Elements
            {
                public const string KeySize = "KeySize";
                public const string KeyType = "KeyType";
                public const string UseKey = "UseKey";
                public const string Entropy = "Entropy";
                public const string BinarySecret = "BinarySecret";
                public const string RequestSecurityToken = "RequestSecurityToken";
                public const string RequestSecurityTokenResponse = "RequestSecurityTokenResponse";
                public const string RequestType = "RequestType";
                public const string TokenType = "TokenType";
                public const string RequestedSecurityToken = "RequestedSecurityToken";
                public const string RequestedAttachedReference = "RequestedAttachedReference";
                public const string RequestedUnattachedReference = "RequestedUnattachedReference";
                public const string RequestedProofToken = "RequestedProofToken";
                public const string ComputedKey = "ComputedKey";
                public const string Claims = "Claims";
                public const string LifeTime = "Lifetime";
                public const string Created = "Created";
                public const string Expires = "Expires";
            }

            /// <summary>
            /// Constantes com os Tipos de Request
            /// </summary>
            public class RequestTypes
            {
                public const string Issue = "http://schemas.xmlsoap.org/ws/2005/02/trust/Issue";
                public const string Validate = "http://schemas.xmlsoap.org/ws/2005/02/trust/Validate";
            }

            /// <summary>
            /// Constantes com os Tipos das chaves
            /// </summary>
            public class KeyTypes
            {
                public const string Public = "http://schemas.xmlsoap.org/ws/2005/02/trust/PublicKey";
                public const string Symmetric = "http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey";
            }

            /// <summary>
            /// Constantes de auxílio do BinaySecretTypes
            /// </summary>
            public class BinarySecretTypes
            {
                public const string AsymmetricKey = "http://schemas.xmlsoap.org/ws/2005/02/trust/AsymmetricKey";
                public const string SymmetricKey = "http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey";
                public const string Nonce = "http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce";
            }

            /// <summary>
            /// Constante do algorítimo de criptografia
            /// </summary>
            public class ComputedKeyAlgorithms
            {
                public const string PSHA1 = "http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1";
            }
        }

        /// <summary>
        /// Contantes para o XML-DigitalSignature
        /// </summary>
        public static class XmlDSig
        {
            public const string NamespaceUri = "http://www.w3.org/2000/09/xmldsig#";

            public static class Elements
            {
                public const string KeyInfo = "KeyInfo";
                public const string KeyValue = "KeyValue";
                public const string RsaKeyValue = "RSAKeyValue";
                public const string Modulus = "Modulus";
                public const string Exponent = "Exponent";
            }
        }

    }
}
